package com.hgl.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hgl.entity.Hgl;
import com.hgl.service.HglService;
import com.hgl.service.impl.HglServiceImpl;


@WebServlet("/admin/user-update-form.let")
public class UserUpdateFormServlet extends HttpServlet {
	
	private HglService hglService = new HglServiceImpl();

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Integer hglId = null;
		try{
			hglId = Integer.valueOf(request.getParameter("hglId"));
		}catch(Exception ex){
			throw new ServletException("参数错误", ex);
		}
		
		Hgl hgl = hglService.get(hglId);
		request.setAttribute("hgl", hgl);
		request.getRequestDispatcher("/admin/user-update-form.jsp").forward(request, response);
		
	}
}
